package android.gpsmessenger;

import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;

public class TripList implements Iterable<String> 
{

	private Map<String,Trip> trips;

	public TripList() {
		trips = new TreeMap<String,Trip>();
	}

	public void addTrip(String name) {
		trips.put(name, new Trip());
	}

	public void addTrip(String name, Trip data) {
		trips.put(name, data);
	}

	public void clear() {
		trips.clear();
	}

	public boolean containsTrip(String name) {
		return trips.keySet().contains(name);
	}
	
	public void removeTrip(String name) {
		trips.remove(name);
	}

	public Trip getTrip(String name) {
		return trips.get(name);
	}

	public Iterator<String> iterator() {
		return trips.keySet().iterator();
	}

	public String toString()
	{
		return trips.keySet().toString();
	}
	
}
